﻿using System;
using NHibernate;
using System.Diagnostics.Contracts;
namespace OpenWaves.ActivityFeed.NHibernate
{
    [ContractClass(typeof(NHibernateSessionProviderContract))]
    public interface INHibernateSessionProvider
    {
        ISession Session { get; } 
    }

    [ContractClassFor(typeof(INHibernateSessionProvider))]
    public class NHibernateSessionProviderContract : INHibernateSessionProvider
    {
        public ISession Session
        {
            get
            {
                Contract.Ensures(Contract.Result<ISession>() != null);
                throw new NotImplementedException();
            }
        }
    }

}